package com.xyc.merchant.goodsOO.service.impl;

import com.xyc.global.bean.GoodsBean;
import com.xyc.merchant.goodsOO.mapper.GoodsOOMapper;
import com.xyc.merchant.goodsOO.service.GoodsService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
@Service
public class GoodsServiceImpl implements GoodsService {
    @Resource
    private GoodsOOMapper goodsOOMapper;

    @Transactional
    @Override
    public void saveGoods(GoodsBean goodsBean) throws Exception {
        goodsOOMapper.saveGoods(goodsBean);
        saveTaocan(goodsBean.getSkuList());
    }
    @Transactional
    @Override
    public void saveTaocan(List<GoodsBean.SkuListBean> skuListBeans) throws Exception {
        goodsOOMapper.saveTaocan(skuListBeans);
    }
}
